package com.hengpeng.itfinoss.controller.util;

import jxl.format.Alignment;
import jxl.format.Border;
import jxl.format.BorderLineStyle;
import jxl.format.Colour;
import jxl.format.UnderlineStyle;
import jxl.write.WritableCellFormat;
import jxl.write.WritableFont;
import jxl.write.WriteException;

public class WritableUtils {
	
	
	
	/**
	 * 设置数据区字体
	 * @return
	 */
	public static WritableFont bodyFont()
	{
		// 设置表体字体
		WritableFont fontBody = new WritableFont(WritableFont.ARIAL, 10, WritableFont.NO_BOLD, false,
				UnderlineStyle.NO_UNDERLINE, Colour.BLACK);
		return fontBody;
	}
	
	/**
	 * 设置单元格样式
	 * @param font
	 * @return
	 * @throws WriteException
	 */
	public static WritableCellFormat cellFormat(WritableFont font) throws WriteException
	{
		WritableCellFormat cFormat = new WritableCellFormat(font);
		cFormat.setAlignment(Alignment.CENTRE);
		cFormat.setBorder(Border.ALL, BorderLineStyle.THIN);
		return cFormat;
	}
	
	/**
	 * 设置头部字体
	 * @return
	 */
	public static WritableFont titleFont()
	{
		WritableFont fontBody = new WritableFont(WritableFont.ARIAL, 15, WritableFont.BOLD, false,
				UnderlineStyle.NO_UNDERLINE, Colour.BLACK);
		return fontBody;
	}
	
}
